package com.xnyzc.lhy.mis.mapper.vehicle;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xnyzc.lhy.mis.entity.result.vehicle.VehicleImportRecordResult;
import com.xnyzc.lhy.mis.entity.vehicle.OaVehicleImportRecord;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 司机处罚导入记录 Mapper 接口
 * </p>
 *
 * @author cuixiaojian
 * @since 2019-12-04
 */
public interface OaVehicleImportRecordMapper extends BaseMapper<OaVehicleImportRecord> {

    /**
     * 车辆导入历史
     * @return
     */
    @Select({"<script>  " +
            "SELECT  " +
            "record.record_id AS recordId, " +
            "record.create_time AS createTime, " +
            "osu.NAME AS operationReturns," +
            "osd.label AS importStatusReturns, " +
            "record.file_id AS fileId,  " +
            "record.file_path AS filePath    " +
            "FROM  " +
            "oa_vehicle_import_record record     " +
            "LEFT JOIN oa_sys_user osu ON osu.sys_user_id = record.operation_id  " +
            "LEFT JOIN oa_sys_dict osd ON osd.VALUE = record.import_status  " +
            "WHERE "+
            "osd.type = 'import_status'  "+
            "AND record.deleted = 0   "+
            "AND record.import_status=0   "+
            "ORDER BY  record.create_time DESC " +
            "</script>"})
    List<VehicleImportRecordResult> queryVehicleImportRecord(IPage iPage);



}
